import { Redirect } from 'umi';
import './index.less';
import Formio from 'formiojs/Formio';

// 数据接口的 token 设定
Formio.registerPlugin(
  {
    requestOptions: (options, url) => {
      options.headers['Authorization'] =
        'Bearer 4FC67B1921CE568C7EED3BA1ACAAF84B'; // 先写死
      return options;
    },
  },
  'requestOptions',
);

export default function Index(props) {
  const { match } = props;
  if (match.path === '/' && match.isExact) return <Redirect to="/list" />;
  return <div>{props.children}</div>;
}
